<?php

namespace App\Model\Task;

use App\Model\Model;
use Hyperf\Database\Model\SoftDeletes;
use Yj\Model\ImageTrait;

/**
 * @property integer $id
 * @property integer $create_time
 * @property integer $update_time
 * @property integer $delete_time
 * @property string $title
 * @property string $desc
 * @property string $image
 */
class TaskTypes extends Model
{
    use SoftDeletes;
    use ImageTrait;

    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'task_types';

    protected $appends = [
        'create_time_format'
    ];

    protected $fillable = [
        'create_time',
        'update_time',
        'delete_time',
        'title',
        'desc',
        'image_id',
    ];

    public function getCreateTimeFormatAttribute(){
        return $this->checkAttributes('create_time_format',function($value){
            return date('Y-m-d H:i:s',$value);
        });
    }

}

